//
//  HJBaseTableViewController.swift
//  HJWeiBo
//
//  Created by 夏航军 on 16/9/23.
//  Copyright © 2016年 夏航军. All rights reserved.
//

import UIKit

class HJBaseTableViewController: UITableViewController,HJVisitorLoginViewDelegate {

    lazy var visitorView : HJVisitorLoginView = HJVisitorLoginView()
    var userLogin = HJUserAccountViewModel.sharedAccountViewModel.userLogin
    
    override func loadView() {

       //判断是否登录,登录就不在显示登录界面
        if userLogin {
            
           super.loadView()

        }else{
            
             view = visitorView
            //设置代理对象
            visitorView.delegate = self
        }
   
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        
    }

//Mark:===============================代理方法的实现=================================
    func userWillLogin() {
        
        //使用模态跳转到下一个的界面
        let oauthVC  = HJOAuthViewController()
        
        let nav = UINavigationController(rootViewController: oauthVC)
        
        present(nav, animated: true, completion: nil)
    }
    
    
    func userWillReigster() {
        print("点击注册按钮")
    }
}
